/**  
 * 所有版权归 陈锦韬 所有
 * @Title:  InterceptorConfig.java   
 * @Package com.rx.config   
 * @Description:    TODO(用一句话描述该文件做什么)   
 * @author: 陈锦韬     
 * @date:   2018年7月22日 下午3:40:53   
 * @version V1.0 
 * @Copyright: 2018 陈锦韬  All rights reserved. 
 */

package com.rx.core.interceptor;

import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**   
 * @ClassName:  InterceptorConfig   
 * @Description:总拦截   
 * @author: 陈锦韬 ,Administrator
 * @date:   2018年7月22日 下午3:40:53     
 * @Copyright: 2018 陈锦韬  All rights reserved. 
 */
public class InterceptorConfig implements HandlerInterceptor {

	@Override
	public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
			throws Exception {
		// 设置编码
		request.setCharacterEncoding("UTF-8");
		return true;
	}

	@Override
	public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,
                           ModelAndView modelAndView) throws Exception {
	}

	@Override
	public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex)
			throws Exception {
	}

}
